package com.traffic.managent.service.order.bean;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;


/**
 * 需要改造 用build模式去做
 * 
 */
public class OrderBean implements Serializable {

	/**
	 * serialVersionUID:TODO(用一句话描述这个变量表示什么).
	 * 
	 * @since JDK 1.6
	 */
	private static final long serialVersionUID = -2879933676159069749L;
	private String phoneNo;// 客户手机号
	private String phoneProvince;// 客户所占省份
	private String phoneAreaCode;
	private String operator;// 1电信 2移动 3联通

	private String vasProdId;// gdp产品id
	private String vasProdName;// 产品名称
	private BigDecimal productPrice;// 产品价格
	private int productSize;// 产品规格

	private String productId;// 运营商产品id
	private String forwardProductId;// 运营商产品id
	private String productName;// 运营商产品名称
	private String productCode;// 运营商产品标示
	private String channel;// 具体的运营商，如广东省联通，宽带公司等
	private String providerId;// 供应商id
	private String productType;// 产品类型 0前向 1后向
	private String region;// 国内或省内

	private String errorMsg;// 错误供应商接口返回原因

	@SuppressWarnings("rawtypes")
	private List provinceProductlists = new ArrayList();// 所对应的运营商产品列表

	private String appkey;// 代理商appkey及用户登录名
	private String customerId;// 客户id
	private String customerName;
	private String accountName;// 客户名称
	private String userId;// 用户id
	private String province; // 账号关联组织机构
	private String department;// 用户所在的组织机构

	private String cstmOrderNo;// 客户订单id
	private String suppOrderNo;// 供应商订单id
	private String callbackUrl;// 回调地址
	private String batchId;// 批开批次号
	private String orderFrom;// 开通渠道 web api 等

	private HashMap<String, Object> params = new HashMap<String, Object>();

	private String orderNo;
	private String message;
	private String status;// 0受理中 1订购中 7订购成功 8订购失败
	private Date orderTime;
	private String ids;
	private String payMode;// 0-客户付款，1-用户付款

	private Date sendTime;// 订购请求时间
	private Date openTime;// 订购开通时间

	private String net;

	private String pKey;
	private String loginName;
	private String secret;
	private String nowRoute;
	private BigDecimal providerPrice;
	private BigDecimal providerDisPrice;
	private Double providerDiscount;
	
	private BigDecimal currentAmount;
	private BigDecimal currentGive;
	private String isPay;
	
	private BigDecimal sellPrice;
	private Double customerDiscount;
	
	private String lastOrder;
	private String orderGoodsId;
	private String orderResultId;
	

	@SuppressWarnings("unused")
	private OrderBean() {
	}

	/**
	 * 
	 * @param phoneNo
	 *            手机号码
	 * @param phoneProvince
	 *            手机号码所在地
	 * @param operator
	 *            手机号码运营商
	 * @param productId
	 *            GDP产品ID
	 * @param productName
	 *            产品名称
	 * @param productPrice
	 *            产品价格
	 * @param productSize
	 *            产品规格及颗粒度
	 * @param userId
	 *            用户id
	 * @param appkey
	 *            用户登录名
	 * @param accountId
	 *            用户账号
	 * @param accountName
	 *            用户账号名称
	 * @param province
	 *            账号所在的组织机构
	 * @param cstmOrderNo
	 *            订单客户流失号
	 * @param callbackUrl
	 *            回调地址
	 * @param batchId
	 *            批开id
	 * @param orderFrom
	 *            订购方式
	 * @param department
	 *            用户所在的组织机构
	 */
	public OrderBean(String phoneNo, String phoneProvince, String phoneAreaCode,String operator, String vasProdId, String productName,
			BigDecimal productPrice, int productSize, String userId, String appkey, String accountId,
			String accountName, String province, String cstmOrderNo, String callbackUrl, String batchId,
			String orderFrom, String payMode, String department,String net) {

		this.setPhoneNo(phoneNo);
		this.setPhoneProvince(phoneProvince);
		this.setPhoneAreaCode(phoneAreaCode);
		this.setOperator(operator);

		this.setVasProdId(vasProdId);
		this.setVasProdName(productName);
		this.setProductSize(productSize);
		this.setProductPrice(productPrice);
		this.setUserId(userId);
		this.setAppkey(appkey);
		this.setCustomerId(accountId);
		this.setAccountName(accountName);
		this.setProvince(province);

		this.setCstmOrderNo(cstmOrderNo);
		this.setCallbackUrl(callbackUrl);
		this.setBatchId(batchId);
		this.setOrderFrom(orderFrom);
		this.setPayMode(payMode);
		this.setDepartment(department);
		this.setNet(net);
	}

	/**
	 * (牵牛3网订购页面对产品有配置统一折扣时)
	 * 
	 * @param phoneNo
	 *            手机号码
	 * @param phoneProvince
	 *            手机号码所在地
	 * @param operator
	 *            手机号码运营商
	 * @param productId
	 *            GDP产品ID
	 * @param productName
	 *            产品名称
	 * @param productPrice
	 *            产品价格
	 * @param productSize
	 *            产品规格及颗粒度
	 * @param userId
	 *            用户id
	 * @param appkey
	 *            用户登录名
	 * @param accountId
	 *            用户账号
	 * @param accountName
	 *            用户账号名称
	 * @param province
	 *            账号所在的组织机构
	 * @param cstmOrderNo
	 *            订单客户流失号
	 * @param callbackUrl
	 *            回调地址
	 * @param batchId
	 *            批开id
	 * @param orderFrom
	 *            订购方式
	 * @param department
	 *            用户所在的组织机构
	 */
	public OrderBean(String phoneNo, String phoneProvince,String phoneAreaCode, String operator, String vasProdId, String productName,
			BigDecimal productPrice, BigDecimal sellPrice, Double customerDiscount, int productSize, String userId,
			String appkey, String accountId, String accountName, String province, String cstmOrderNo,
			String callbackUrl, String batchId, String orderFrom, String payMode, String department,String net) {

		this.setPhoneNo(phoneNo);
		this.setPhoneProvince(phoneProvince);
		this.setPhoneAreaCode(phoneAreaCode);
		this.setOperator(operator);

		this.setVasProdId(vasProdId);
		this.setVasProdName(productName);
		this.setProductSize(productSize);

		// this.setProductPrice(productPrice);
		this.setProductPrice1(sellPrice); // 实际销售价格, 账户扣款
		this.setOrderPriceAndCustomerDiscount(productPrice, customerDiscount); // 设置"产品原价+折扣"

		this.setUserId(userId);
		this.setAppkey(appkey);
		this.setCustomerId(accountId);
		this.setAccountName(accountName);
		this.setProvince(province);

		this.setCstmOrderNo(cstmOrderNo);
		this.setCallbackUrl(callbackUrl);
		this.setBatchId(batchId);
		this.setOrderFrom(orderFrom);
		this.setPayMode(payMode);
		this.setDepartment(department);
		this.setNet(net);
	}

	/**
	 * 
	 * @param phoneNo
	 *            手机号码
	 * @param phoneProvince
	 *            手机号码所在地
	 * @param operator
	 *            手机号码运营商
	 * @param productId
	 *            GDP产品ID
	 * @param productName
	 *            产品名称
	 * @param productPrice
	 *            产品价格
	 * @param productSize
	 *            产品规格及颗粒度
	 * @param userId
	 *            用户id
	 * @param appkey
	 *            用户登录名
	 * @param accountId
	 *            用户账号
	 * @param accountName
	 *            用户账号名称
	 * @param province
	 *            账号所在的组织机构
	 * @param cstmOrderNo
	 *            订单客户流失号
	 * @param callbackUrl
	 *            回调地址
	 * @param batchId
	 *            批开id
	 * @param orderFrom
	 *            订购方式
	 * @param department
	 *            用户所在的组织机构
	 */
	public OrderBean(String phoneNo, String phoneProvince, String operator, String vasProdId, String vasproductName,
			BigDecimal productPrice, int productSize, String userId, String appkey, String accountId,
			String accountName, String province, String cstmOrderNo, String callbackUrl, String batchId,
			String orderFrom, String payMode, String department, String productCode, String productId,
			String productName, String channel, String providerId, String region) {

		this.setPhoneNo(phoneNo);
		this.setPhoneProvince(phoneProvince);
		this.setOperator(operator);

		this.setVasProdId(vasProdId);
		this.setVasProdName(vasproductName);
		this.setProductSize(productSize);
		this.setProductPrice(productPrice);

		this.setUserId(userId);
		this.setAppkey(appkey);
		this.setCustomerId(accountId);
		this.setAccountName(accountName);
		this.setProvince(province);

		this.setCstmOrderNo(cstmOrderNo);
		this.setCallbackUrl(callbackUrl);
		this.setBatchId(batchId);
		this.setOrderFrom(orderFrom);
		this.setPayMode(payMode);
		this.setDepartment(department);

		this.setProductCode(productCode);
		this.setProductId(productId);
		this.setProductName(productName);
		this.setChannel(channel);
		this.setProviderId(providerId);
		this.setRegion(region);
	}

	

	

	
	/** 注入账号信息 **/
	public OrderBean buildAccount(String pKey, String loginName, String secret) {
		this.setpKey(pKey);
		this.setLoginName(loginName);
		this.setSecret(secret);
		return this;
	}

	public String getProductType() {
		return productType;
	}

	public void setProductType(String productType) {
		addParam("productType", productType);
		this.productType = productType;
	}

	public String getProviderId() {
		return providerId;
	}

	public void setProviderId(String providerId) {
		addParam("providerId", providerId);
		this.providerId = providerId;
	}

	public String getVasProdId() {
		return vasProdId;
	}

	public void setVasProdId(String vasProdId) {
		addParam("vasProdId", vasProdId);
		this.vasProdId = vasProdId;
	}

	public String getVasProdName() {
		return vasProdName;
	}

	public void setVasProdName(String vasProdName) {
		addParam("vasProdName", vasProdName);
		this.vasProdName = vasProdName;
	}

	public String getProductCode() {
		return productCode;
	}

	public void setProductCode(String productCode) {
		addParam("productCode", productCode);
		this.productCode = productCode;
	}

	public String getPayMode() {
		return payMode;
	}

	public void setPayMode(String payMode) {
		addParam("payMode", payMode);
		this.payMode = payMode;
	}

	public String getIds() {
		addParam("ids", ids);
		return ids;
	}

	public void setIds(String ids) {
		this.ids = ids;
	}

	public Date getOrderTime() {
		return orderTime;
	}

	public void setOrderTime(Date orderTime) {
		addParam("orderTime", orderTime);
		this.orderTime = orderTime;
	}

	public String getOrderNo() {
		return orderNo;
	}

	public void setOrderNo(String orderNo) {
		addParam("orderNo", orderNo);
		this.orderNo = orderNo;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		addParam("message", message);
		this.message = message;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		addParam("status", status);
		this.status = status;
	}

	public String getOrderFrom() {
		return orderFrom;
	}

	public void setOrderFrom(String orderFrom) {
		addParam("orderFrom", orderFrom);
		this.orderFrom = orderFrom;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		addParam("province", province);
		this.province = province;
	}

	public void addParam(String k, Object v) {
		params.put(k, v);
	}

	public HashMap<String, Object> getParams() {
		return params;
	}

	public String getBatchId() {
		return batchId;
	}

	public void setBatchId(String batchId) {
		addParam("batchId", batchId);
		this.batchId = batchId;
	}

	public String getPhoneNo() {
		return phoneNo;
	}

	public void setPhoneNo(String phoneNo) {
		addParam("phoneNo", phoneNo);
		this.phoneNo = phoneNo;
	}

	public String getProductId() {
		return productId;
	}

	public void setProductId(String productId) {
		addParam("productId", productId);
		this.productId = productId;
	}

	public String getProductName() {
		return productName;
	}

	public void setProductName(String productName) {
		addParam("productName", productName);
		this.productName = productName;
	}

	public BigDecimal getProductPrice() {
		return productPrice;
	}

	public void setProductPrice(BigDecimal productPrice) {
//		addParam("sellPrice", productPrice);
		addParam("orderPrice", productPrice);
		this.productPrice = productPrice;
	}

	public void setProductPrice1(BigDecimal sellPrice) {
		addParam("sellPrice", sellPrice);
		this.productPrice = sellPrice;
	}

	public void setOrderPriceAndCustomerDiscount(BigDecimal productPrice, Double customerDiscount) {
		addParam("orderPrice", productPrice);
		addParam("customerDiscount", customerDiscount);
	}

	public String getCstmOrderNo() {
		return cstmOrderNo;
	}

	public void setCstmOrderNo(String cstmOrderNo) {
		addParam("cstmOrderNo", cstmOrderNo);
		this.cstmOrderNo = cstmOrderNo;
	}

	public String getCallbackUrl() {
		return callbackUrl;
	}

	public void setCallbackUrl(String callbackUrl) {
		addParam("callbackUrl", callbackUrl);
		this.callbackUrl = callbackUrl;
	}

	public String getPhoneProvince() {
		return phoneProvince;
	}

	public void setPhoneProvince(String phoneProvince) {
		addParam("phoneProvince", phoneProvince);
		this.phoneProvince = phoneProvince;
	}

	@SuppressWarnings("rawtypes")
	public List getProvinceProductlists() {
		return provinceProductlists;
	}

	@SuppressWarnings("rawtypes")
	public void setProvinceProductlists(List provinceProductlists) {
		// addParam("provinceProductlists",provinceProductlists);
		this.provinceProductlists = provinceProductlists;
	}

	public String getCustomerId() {
		return customerId;
	}

	public void setCustomerId(String customerId) {
		addParam("customerId", customerId);
		this.customerId = customerId;
	}

	public String getAccountName() {
		return accountName;
	}

	public void setAccountName(String accountName) {
		this.accountName = accountName;
	}

	public String getOperator() {
		return operator;
	}

	public void setOperator(String operator) {
		addParam("operator", operator);
		this.operator = operator;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		addParam("userId", userId);
		this.userId = userId;
	}

	public String getAppkey() {
		return appkey;
	}

	public void setAppkey(String appkey) {
		this.appkey = appkey;
	}

	public String getChannel() {
		return channel;
	}

	public void setChannel(String channel) {
		addParam("channel", channel);
		this.channel = channel;
	}

	public int getProductSize() {
		return productSize;
	}

	public void setProductSize(int productSize) {
		addParam("productSize", productSize);
		this.productSize = productSize;
	}

	public Date getSendTime() {
		return sendTime;
	}

	public void setSendTime(Date sendTime) {
		addParam("sendTime", sendTime);
		this.sendTime = sendTime;
	}

	public Date getOpenTime() {
		return openTime;
	}

	public void setOpenTime(Date openTime) {
		addParam("openTime", openTime);
		this.openTime = openTime;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		addParam("department", department);
		this.department = department;
	}

	public String getRegion() {
		return region;
	}

	public void setRegion(String region) {
		addParam("region", region);
		this.region = region;
	}

	public String getSuppOrderNo() {
		return suppOrderNo;
	}

	public void setSuppOrderNo(String suppOrderNo) {
		addParam("region", region);
		this.suppOrderNo = suppOrderNo;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		addParam("errorMsg", errorMsg);
		this.errorMsg = errorMsg;
	}

	public String getNet() {
		return net;
	}

	public void setNet(String net) {
		this.net = net;
		addParam("net", net);
	}

	public String getForwardProductId() {
		return forwardProductId;
	}

	public void setForwardProductId(String forwardProductId) {
		this.forwardProductId = forwardProductId;
	}

	public String getpKey() {
		return pKey;
	}

	public void setpKey(String pKey) {
		this.pKey = pKey;
	}

	public String getLoginName() {
		return loginName;
	}

	public void setLoginName(String loginName) {
		this.loginName = loginName;
	}

	public String getSecret() {
		return secret;
	}

	public void setSecret(String secret) {
		this.secret = secret;
	}

	public String getNowRoute() {
		return nowRoute;
	}

	public void setNowRoute(String nowRoute) {
		addParam("nowRoute", nowRoute);
		this.nowRoute = nowRoute;
	}

	public String getPhoneAreaCode() {
		return phoneAreaCode;
	}

	public void setPhoneAreaCode(String phoneAreaCode) {
		addParam("phoneAreaCode", phoneAreaCode);
		this.phoneAreaCode = phoneAreaCode;
	}

	public BigDecimal getProviderPrice() {
		return providerPrice;
	}

	public void setProviderPrice(BigDecimal providerPrice) {
		addParam("providerPrice", providerPrice);
		this.providerPrice = providerPrice;
	}

	public Double getProviderDiscount() {
		return providerDiscount;
	}

	public void setProviderDiscount(Double providerDiscount) {
		addParam("providerDiscount", providerDiscount);
		this.providerDiscount = providerDiscount;
	}


	public BigDecimal getProviderDisPrice() {
		return providerDisPrice;
	}

	public void setProviderDisPrice(BigDecimal providerDisPrice) {
		addParam("providerDisPrice", providerDisPrice);
		this.providerDisPrice = providerDisPrice;
	}

	public BigDecimal getCurrentAmount() {
		return currentAmount;
	}

	public void setCurrentAmount(BigDecimal currentAmount) {
		addParam("currentAmount", currentAmount);
		this.currentAmount = currentAmount;
	}

	public BigDecimal getCurrentGive() {
		return currentGive;
	}

	public void setCurrentGive(BigDecimal currentGive) {
		addParam("currentGive", currentGive);
		this.currentGive = currentGive;
	}

	public String getIsPay() {
		return isPay;
	}

	public void setIsPay(String isPay) {
		addParam("isPay", isPay);
		this.isPay = isPay;
	}

	public BigDecimal getSellPrice() {
		return sellPrice;
	}

	public void setSellPrice(BigDecimal sellPrice) {
		addParam("sellPrice", sellPrice);
		this.sellPrice = sellPrice;
	}

	public Double getCustomerDiscount() {
		return customerDiscount;
	}

	public void setCustomerDiscount(Double customerDiscount) {
		addParam("customerDiscount", customerDiscount);
		this.customerDiscount = customerDiscount;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		addParam("customerName", customerName);
		this.customerName = customerName;
	}

	public String getLastOrder() {
		return lastOrder;
	}

	public void setLastOrder(String lastOrder) {
		addParam("lastOrder", lastOrder);
		this.lastOrder = lastOrder;
	}

	public String getOrderGoodsId() {
		return orderGoodsId;
	}

	public void setOrderGoodsId(String orderGoodsId) {
		addParam("orderGoodsId", orderGoodsId);
		this.orderGoodsId = orderGoodsId;
	}

	public String getOrderResultId() {
		return orderResultId;
	}

	public void setOrderResultId(String orderResultId) {
		addParam("orderResultId",orderResultId);
		this.orderResultId = orderResultId;
	}

}
